package com.xnyzc.lhy.common.penum;

import com.xnyzc.lhy.common.entity.PEnum;

/**
 * @Author: huxuekuo
 * @Date: 2019-07-19 15:08
 * @Description:
 */
public enum EOrderType implements PEnum<String> {
    ZFJC("ZFJC", "自费叫车"),
    GRGW("GRGW", "个人公务"),
    BMGW("BMGW", "部门公务"),
    SPGW("SPGW", "审批公务"),
    BKCP("BKCP", "拼车"),
    // 个人提额
    TEGR("TEGR", "个人提额"),
    // 公务提额
    TEGW("TEGW", "部门提额"),
    // 充值余额
    CZYE("CZYE", "充值余额"),

    REFUND("REFUND", "退款流水号");

    private String desc;
    private String msg;

    EOrderType(String desc, String msg) {
        this.desc = desc;
        this.msg = msg;
    }

    @Override
    public String getValue() {
        return this.desc;
    }

    @Override
    public String toString() {
        return name();
    }

    @Override
    public String toChString() {
        return desc;
    }

    public static String findByOrderType(String orderId) {
        EOrderType[] values = EOrderType.values();
        for (EOrderType value : values) {
            if (orderId.contains(value.getValue())) {
                return value.getMsg();
            }
        }
        return "";
    }

    public String getMsg() {
        return msg;
    }

    public String getDesc() {
        return desc;
    }
}
